package com.huike.report.mapper;

import java.util.List;
import java.util.Map;

import com.huike.report.domain.vo.ChangeStatisticsVo;
import com.huike.report.domain.vo.LineSeriesVO;
import com.huike.report.domain.vo.SubjectStatisticsVO;
import org.apache.ibatis.annotations.Param;

import com.huike.clues.domain.vo.IndexStatisticsVo;

/**
 * 首页统计分析的Mapper
 * @author Administrator
 *
 */
public interface ReportMapper {
	/**=========================================基本数据========================================*/
	/**
	 * 获取线索数量
	 * @param beginCreateTime	开始时间
	 * @param endCreateTime		结束时间
	 * @param username			用户名
	 * @return
	 */
	Integer getCluesNum(@Param("startTime") String beginCreateTime,
						@Param("endTime") String endCreateTime,
						@Param("username") String username);

	/**
	 * 获取商机数量
	 * @param beginCreateTime	开始时间
	 * @param endCreateTime		结束时间
	 * @param username			用户名
	 * @return
	 */
	Integer getBusinessNum(@Param("startTime") String beginCreateTime,
						   @Param("endTime") String endCreateTime,
						   @Param("username") String username);

	/**
	 * 获取合同数量
	 * @param beginCreateTime	开始时间
	 * @param endCreateTime		结束时间
	 * @param username			用户名
	 * @return
	 */
	Integer getContractNum(@Param("startTime") String beginCreateTime,
						   @Param("endTime") String endCreateTime,
						   @Param("username") String username);

	/**
	 * 获取合同金额
	 * @param beginCreateTime	开始时间
	 * @param endCreateTime		结束时间
	 * @param username			用户名
	 * @return
	 */
	Double getSalesAmount(@Param("startTime") String beginCreateTime,
						  @Param("endTime") String endCreateTime,
						  @Param("username") String username);

	/**=========================================今日简报========================================*/
	Integer getTodayCluesNum(@Param("now") String now,@Param("username") String username);

	Integer getTodayBusinessNum(@Param("now") String now,@Param("username") String username);

	Double getTodaySalesAmount(@Param("now") String now,@Param("username") String username);

	Integer getTodayContractNum(@Param("now") String now,@Param("username") String username);

    /**=========================================待办========================================*/
	Integer getToallocatedBusinessNum(@Param("username") String username,@Param("beginTime") String beginTime,@Param("endTime") String endTime);

	Integer getToallocatedCluesNum(@Param("username") String username,@Param("beginTime") String beginTime,@Param("endTime") String endTime);

	Integer getTofollowedBusinessNum(@Param("username") String username,@Param("beginTime") String beginTime,@Param("endTime") String endTime);

	Integer getTofollowedCluesNum(@Param("username") String username,@Param("beginTime") String beginTime,@Param("endTime") String endTime);

	List<SubjectStatisticsVO> getSubjectStatistics(@Param("beginTime") String beginCreateTime,@Param("endTime") String endCreateTime);

    List<Map> getcluesDataNum(@Param("beginTime") String beginTime,@Param("endTime") String endTime);

	Integer getBusinessNums(@Param("beginTime") String beginTime,@Param("endTime") String endTime);

	Integer getCluesNums(@Param("beginTime") String beginTime,@Param("endTime") String endTime);

	Integer getContractNums(@Param("beginTime") String beginTime,@Param("endTime") String endTime);

	Integer getEffectiveCluesNums(@Param("beginTime") String beginTime,@Param("endTime") String endTime);

    List<ChangeStatisticsVo> getBusinessChangeStatistics(@Param("beginTime") String beginTime,@Param("endTime") String endTime);

	Integer getBusinessCount(@Param("beginTime") String beginTime,@Param("endTime") String endTime);

	Long getContractCount(@Param("beginTime") String beginTime,@Param("endTime") String endTime,@Param("createBy") String createBy);

	List<ChangeStatisticsVo> getClueStatistic(@Param("beginTime") String beginTime,@Param("endTime") String endTime);

	Integer getCluecount(@Param("beginTime") String beginTime,@Param("endTime") String endTime);

	Long getBusinessCountByCreateBy(@Param("beginTime") String beginTime,@Param("endTime") String endTime,@Param("createBy") String createBy);
}
